package routers

import (
	"gvb_server/api"
	"gvb_server/middleware"
)

func (routerGroup RouterGroup) ArticleRouter() {
	articleApi := api.ApiGroupApp.ArticleApi
	routerGroup.POST("/articles", middleware.JwtAuth(), articleApi.ArticleCreateView)
	routerGroup.GET("/articles", middleware.JwtAuth(), articleApi.ArticleListView)
	routerGroup.GET("/articles/:id", middleware.JwtAuth(), articleApi.ArticleDetailView)
	routerGroup.GET("/articles/detail", middleware.JwtAuth(), articleApi.ArticleDetailByTitleView)
	routerGroup.GET("/articles/calendar", articleApi.ArticleCalendarView)
	routerGroup.GET("/articles/tag_list", articleApi.ArticleTagListView)
	routerGroup.PUT("/articles", articleApi.ArticleUpdateView)
	routerGroup.DELETE("/articles", articleApi.ArticleRemoveView)
}
